{include file="bushen/top" /}
<input type="hidden" id="bids" value="{$row.id}">
<div class="tabs">
    <div class="tab-top-label">
        {include file="bushen/table_top" /}
        {if $type == 1}
        <label class="tab-label" for="tab5">本车车损</label>
        {/if}
        {if $type == 2}
        <label class="tab-label" for="tab6">三者车损</label>
        {/if}
        {if $type == 3}
        <label class="tab-label" for="tab7">三者财务损失</label>
        {/if}
        {if $type == 4}
        <label class="tab-label" for="tab8">本车人伤</label>
        {/if}
        {if $type == 5}
        <label class="tab-label" for="tab9">三者人伤</label>
        {/if}
        <label class="tab-label" for="tab10">理算</label>
        <label class="tab-label" for="tab11">补偿款信息</label>
    </div>

    <div class="tabs-content">
        {include file="bushen/table_con" /}
        <!--本车损失-->
        {include file="bushen/hepei/benche" /}
        <!--三者车-->
        {if $type == 2}
        {include file="bushen/hejia/sanzheche" /}
        {/if}
        <!--三者财务损失-->
        {if $type == 3}
        {include file="bushen/hejia/sanzhecai" /}
        {/if}
        <!--本车人伤-->
        {if $type == 4}
        {include file="bushen/lisuan/benren" /}
        {/if}
        <!--三者人伤-->
        {if $type == 5}
        {include file="bushen/hejia/sanzheren" /}
        {/if}
        {include file="bushen/hepei/lisuan" /}
        {include file="bushen/hepei/buchangkuan" /}
    </div>
</div>

{include file="bushen/yijian" /}

<div class="conts" style="margin-top:20px">
    <span style="width:98%;margin: 1%;">审核意见</span>
    <textarea name="audit_reason" id="audit_reason" cols="30" rows="10"
              style="width:98%;height: 100px;margin: 1%;"></textarea>
</div>
<div class="btns1">
    <button class="tongbtn" type="button" onclick="shenhe_ok(this)">通过审核</button>
    <button class="tuibtn" type="button" onclick="shenhe_no(this)">退回</button>
</div>
<style>
    .btns1 {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btns1 button {
        border: 0px;
        padding: 5px 10px;
        border-radius: 4px;
    }

    .btns1 .tongbtn {
        background: #FF5722;
        color: #fff;
        margin-right: 15px;
    }

    .btns1 .tuibtn {
        background: green;
        color: #fff;
    }
</style>
<script type="text/javascript">
    function shenhe_no(obj) {
        var audit_reason = $('#audit_reason').val();
        if (audit_reason == '') {
            layer.msg("请输入审核原因");
            return false
        }
        layer.confirm('确定' + $(obj).text() + '？', {icon: 3, title: $(obj).text()}, function (index) {
            var id = {$orderid};
            var tuihui = audit_reason;
            $.ajax({
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "{:url('bushen/hepei/tuihui')}",//url
                data: {id: id, tuihui: tuihui, type: "{$type}", bid: "{$bid}"},
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, {time: 2000}, function () {
                            layer.closeAll()
                            parent.layer.closeAll();
                            parent.$("#table").bootstrapTable('refresh', {});
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
        });

    }

    function shenhe_ok(obj) {
        var audit_reason = $('#audit_reason').val();
        if (audit_reason == '') {
            layer.msg("请输入审核原因");
            return false
        }
        layer.confirm('确定' + $(obj).text() + '？', {icon: 3, title: $(obj).text()}, function (index) {
            var id = {$orderid};
            var tuihui = audit_reason;
            $.ajax({
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "{:url('bushen/hepei/shen')}",//url
                data: {id: id, tuihui: tuihui, type: "{$type}", bid: "{$bid}"},
                success: function (res) {
                    if (res.code == 1) {
                        layer.msg(res.msg, {time: 2000}, function () {
                            layer.closeAll()
                            parent.layer.closeAll();
                            parent.$("#table").bootstrapTable('refresh', {});
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
        });
    }

</script>